﻿$libfx0 = @"
    public  enum colour { 
        red=101, 
        green, 
        blue,
        black 
    };
    [DllImport("libfx0.dll")]
        public static extern void EnumString(colour rainbow, 
                                              System.Text.StringBuilder rainbowcolour);
"@

Add-Type -MemberDefinition $libfx0 -Namespace fx0 -Name "st_fx"

$colourstring = New-Object System.Text.StringBuilder @("once upon a time ... ");
$somecolour = New-Object fx0.st_fx+colour
$somecolour = [fx0.st_fx+colour]::blue
[fx0.st_fx]::EnumString($somecolour, $colourstring)
Write-Host $colourstring
